import request from "@/utils/request";
import { AxiosPromise } from "axios";
import {OrderQuery} from "./types";

/**
 * 标准订单分页数据
 *
 * @param queryParams
 */
export function getOrderPage(queryParams) {
	return request({
		url: '/api/v1/originalOmsOrder/page',
		method: 'get',
		params: queryParams
	});
}

/**
 * 导入OMS原始单据
 *
 * @param storeCode 店铺编码
 * @param type 单据类型
 * @param file
 */
export function importOmsData(storeCode: any, type: string, file: any) {
	const formData = new FormData();
	formData.append('file', file);
	return request({
		url: '/api/v1/omsOrder/_import/' + storeCode + '/' +type,
		method: 'post',
		data: formData,
		headers: {
			'Content-Type': 'multipart/form-data'
		}
	});
}

/**
 * 导出Oms订单
 *
 * @param ids
 * @returns
 */
export function exportOmsOrder(ids: any) {
	return request({
		url: '/api/v1/originalOmsOrder/_export?ids='+ids,
		method: 'get',
		responseType: 'arraybuffer'
	});
}

